// 引入封装好的接口
import {menuList} from '../../../request/api';
const state = {
    menuList:[]
};

const getters = {
    getMenuList(state){
        return state.menuList
    }
};

const mutations = {
    REQ_MENULIST(state,payload){
        state.menuList = payload
    }
};

const actions = {
    async changeMenuAction({commit}){
        let res = await menuList({
            istree:1
        });
        commit('REQ_MENULIST',res.list)
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    // 命名空间
    namespaced:true
}